<%@page import="com.ignou.mca.datasource.DatabaseOperations"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="theme/style.css"
	media="screen" />
<title>OES - Delete Subject</title>
</head>
<body>
	<div id="MainWrapper">
		<jsp:include page="header.jsp" /> 
		<jsp:include page="LeftContainer.jsp" />
		<div id="MainContent">
			<center><h2>Delete Subject</h2></center>
		<%
			int subjectId = Integer.parseInt(request.getParameter("subject"));
			if(subjectId<1)
			{
				out.println("<br><br><center><font color='red'>Invalid subject.<b></b></font></center>");
			}else
			{
				DatabaseOperations dbOperations = new DatabaseOperations();
				Boolean isDeleted = dbOperations.deleteSubject(subjectId);
				if(isDeleted)
				{
					response.sendRedirect("./Subjects.jsp");
				}else
				{
					out.println("<br><br><center><font color='red'>unable to delete subject.<b></b></font></center>");
				}
			}
		%>
		
		</div>
		<jsp:include page="footer.jsp" />
	</div>
</body>
</html>